package com.theblind.agent;

import javassist.ClassPool;

import java.lang.instrument.Instrumentation;

/**
 * @program: SyncAgent
 * @description:
 * @author: TheBlind
 * @create: 2020-12-19 14:35
 **/
public class SyncAgent {
    public static void premain(String agentArgs, Instrumentation inst) {
        System.out.println("开始代理");
        MonitorTransformer monitor = new MonitorTransformer();
        if (agentArgs != null && agentArgs != "") {
            MonitorTransformer.visitPage = agentArgs;
        }

        System.out.println("isRedefineClassesSupported" + inst.isRedefineClassesSupported());
        inst.addTransformer(monitor);
        System.out.println("代理结束");
    }

    public static void premain() {

    }

}
